package testcase.validationtest;

import validation.FourWithDualSolo;
import validation.Type;
import card.Card;
import card.Cardset;
import junit.framework.TestCase;

public class FourWithDualSoloTest extends TestCase{
	private Type aaaabc;
	private Cardset cardset;
	@Override
	public void setUp(){
		cardset = new Cardset(6);
		aaaabc = FourWithDualSolo.getInstance();
	}
	@Override
	public void tearDown(){
		aaaabc.clear();
		aaaabc = null;
	}
	// testcases
	public void testCorr1(){
		cardset = new Cardset(6);
		cardset.clear();
		cardset.add(new Card('s','A'));
		cardset.add(new Card('h','A'));
		cardset.add(new Card('c','A'));
		cardset.add(new Card('d','A'));
		cardset.add(new Card('s','3'));
		cardset.add(new Card('h','4'));
		assertEquals(FourWithDualSolo.getInstance().identify(cardset), aaaabc);
	}
	public void testCorr2(){
		cardset = new Cardset(6);
		cardset.clear();
		cardset.add(new Card('s','2'));
		cardset.add(new Card('h','2'));
		cardset.add(new Card('c','2'));
		cardset.add(new Card('d','2'));
		cardset.add(new Card('s','A'));
		cardset.add(new Card('h','4'));
		assertEquals(FourWithDualSolo.getInstance().identify(cardset), aaaabc);
	}
	public void testInCorr1(){
		cardset = new Cardset(6);
		cardset.clear();
		cardset.add(new Card('s','2'));
		cardset.add(new Card('h','2'));
		cardset.add(new Card('c','3'));
		cardset.add(new Card('d','2'));
		cardset.add(new Card('s','A'));
		cardset.add(new Card('h','4'));
		assertEquals(FourWithDualSolo.getInstance().identify(cardset), null);
	}
	public void testInCorr2(){
		cardset = new Cardset(7);
		cardset.clear();
		cardset.add(new Card('s','2'));
		cardset.add(new Card('h','2'));
		cardset.add(new Card('c','2'));
		cardset.add(new Card('d','2'));
		cardset.add(new Card('s','A'));
		cardset.add(new Card('h','7'));
		cardset.add(new Card('h','8'));
		assertEquals(FourWithDualSolo.getInstance().identify(cardset), null);
	}
	public void testInCorr3(){
		cardset = new Cardset(8);
		cardset.clear();
		cardset.add(new Card('s','A'));
		cardset.add(new Card('h','4'));
		cardset.add(new Card('s','2'));
		cardset.add(new Card('h','2'));
		cardset.add(new Card('c','2'));
		cardset.add(new Card('d','2'));
		assertEquals(FourWithDualSolo.getInstance().identify(cardset), aaaabc);
	}
	public void testPrior(){
		cardset = new Cardset(6);
		cardset.add(new Card('s','2'));
		cardset.add(new Card('h','2'));
		cardset.add(new Card('c','2'));
		cardset.add(new Card('d','2'));
		cardset.add(new Card('s','A'));
		cardset.add(new Card('h','4'));
		Cardset temp = new Cardset(6);
		temp.add(new Card('s','3'));
		temp.add(new Card('h','3'));
		temp.add(new Card('c','3'));
		temp.add(new Card('d','3'));
		temp.add(new Card('s','A'));
		temp.add(new Card('h','4'));
		aaaabc.lessPriorityThan(cardset);
		assertEquals(aaaabc.lessPriorityThan(temp), false);
	}
}
